<div navbar ng-init="currentItem='service.apache'"></div>
<div ng-show="Auth.processing||!loaded">
    <div loading></div>
</div>

<div id="main" ng-show="!Auth.processing&&loaded" style="display:none" ng-init="checkInstalled()">
    <div class="module-header">
        <h3>Apache - 广泛使用的老牌开源 HTTP 服务器软件</h3>
    </div>

    <div srvinstall ng-init="name='Apache';pkg='apache';expected_repolist=['base','CentALT'];"></div>

    <div class="tabbable" ng-show="installed">
        <ul class="nav nav-tabs">
            <li ng-class="'active' | iftrue:activeTabName=='base'"><a href="#base" ng-click="sec('base')" data-toggle="tab">基本信息</a></li>
            <li ng-class="'active' | iftrue:activeTabName=='setting'"><a href="#setting" ng-click="sec('setting')" data-toggle="tab">服务设置</a></li>
            <li ng-class="'active' | iftrue:activeTabName=='ext'"><a href="#ext" ng-click="sec('ext')" data-toggle="tab">扩展</a></li>
            <li ng-class="'active' | iftrue:activeTabName=='configfile'"><a href="#configfile" ng-click="sec('configfile')" data-toggle="tab">配置文件</a></li>
            <li ng-class="'active' | iftrue:activeTabName=='logfile'"><a href="#logfile" ng-click="sec('logfile')" data-toggle="tab">日志</a></li>
            <li ng-class="'active' | iftrue:activeTabName=='update'"><a href="#update" ng-click="sec('update')" data-toggle="tab">升级</a></li>
            <li ng-class="'active' | iftrue:activeTabName=='uninstall'"><a href="#uninstall" ng-click="sec('uninstall')" data-toggle="tab">卸载</a></li>
        </ul>
        <div class="tab-content">
            <div class="tab-pane" ng-class="'active' | iftrue:activeTabName=='base'" id="base">
                <div srvbase ng-init="name='Apache';pkg='apache';service='httpd';"></div>
            </div>
            <div class="tab-pane" ng-class="'active' | iftrue:activeTabName=='setting'" id="setting">
                <form class="form-horizontal form-horizontal-small" ng-submit="updateSetting()" onsubmit="return false">
                    <div class="form-group form-inline">
                        <label class="col-sm-2 control-label" for="setting_listen">监听端口</label>
                        <div class="col-sm-10">
                            <input class="form-control" ng-model="settings.listen" ng-disabled="processing" type="text" id="setting_listen" placeholder="监听的端口">
                        </div>
                    </div>
                    <div class="form-group form-inline">
                        <label class="col-sm-2 control-label" for="setting_server_admin">管理员邮箱</label>
                        <div class="col-sm-10">
                            <input class="form-control" ng-model="settings.serveradmin" ng-disabled="processing" type="text" id="setting_server_admin" placeholder="网络管理员的电子邮件地址">
                        </div>
                    </div>
                    <div class="form-group form-inline">
                        <label class="col-sm-2 control-label" for="setting_server_name">主机名称</label>
                        <div class="col-sm-10">
                            <input class="form-control" ng-model="settings.servername" ng-disabled="processing" type="text" id="setting_server_name" placeholder="服务器主机名称">
                        </div>
                    </div>
                    <div class="form-group form-inline">
                        <label class="col-sm-2 control-label" for="setting_document_root">主目录</label>
                        <div class="col-sm-10">
                            <div class="input-group">
                                <input class="form-control" ng-model="settings.documentroot" ng-disabled="processing" type="text" id="setting_document_root" placeholder="服务器主目录">
                                <span class="input-group-btn">
                                    <button class="btn btn-default" ng-click="selectstaticfolder($index)">
                                        <i class="glyphicon glyphicon-folder-open"></i>
                                    </button>
                                </span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group form-inline">
                        <label class="col-sm-2 control-label" for="setting_directory_index">默认文档</label>
                        <div class="col-sm-10">
                            <input class="form-control" ng-model="settings.directoryindex" ng-disabled="processing" type="text" id="setting_directory_index" placeholder="默认文档">
                        </div>
                    </div>
                    <div class="form-group form-inline">
                        <label class="col-sm-2 control-label" for="setting_default_type">MIME类型</label>
                        <div class="col-sm-10">
                            <input class="form-control" ng-model="settings.defaulttype" ng-disabled="processing" type="text" id="setting_default_type" placeholder="默认文件类型">
                            <select class="form-control" ng-model="settings.defaulttype" ng-disabled="processing" type="text">
                                <option value="text/plain">纯文本（默认）</option>
                                <option value="text/html">HTML</option>
                                <option value="text/xml">XML</option>
                                <option value="application/octet-stream">流文件</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group form-inline">
                        <label class="col-sm-2 control-label" for="setting_default_charset">默认编码</label>
                        <div class="col-sm-10">
                            <input class="form-control" ng-model="settings.adddefaultcharset" ng-disabled="processing" type="text" id="setting_default_charset" placeholder="默认编码">
                            <select class="form-control" ng-model="settings.adddefaultcharset" ng-disabled="processing" type="text">
                                <option value="UTF-8">UTF-8（默认）</option>
                                <option value="GB2312">GB2312</option>
                                <option value="GBK">GBK</option>
                                <option value="GB18030">GB18030</option>
                                <option value="BIG5">BIG5</option>
                                <option value="EUC-JP">EUC-JP</option>
                                <option value="EUC-KR">EUC-KR</option>
                                <option value="ISO-8859-1">ISO-8859-1</option>
                                <option value="ISO-8859-2">ISO-8859-2</option>
                                <option value="Shift_JIS">Shift_JIS</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group form-inline">
                        <label class="col-sm-2 control-label">Gzip压缩</label>
                        <div class="col-sm-10">
                            <label class="checkbox-inline"><input ng-model="settings.gzip" type="checkbox" class="ng-valid ng-dirty"> 开启Gzip压缩</label>
                        </div>
                    </div>
                    <div class="form-group form-inline">
                        <label class="col-sm-2 control-label" for="setting_access_file_name">权限控制文件</label>
                        <div class="col-sm-10">
                            <input class="form-control" ng-model="settings.accessfilename" ng-disabled="processing" type="text" id="setting_access_file_name" placeholder="AccessFileName">
                        </div>
                    </div>
                    <div class="form-group form-inline">
                        <label class="col-sm-2 control-label" for="setting_timeout">连接超时</label>
                        <div class="col-sm-10">
                            <div class="input-group">
                                <input class="form-control" ng-model="settings.timeout" ng-disabled="processing" type="text" id="setting_timeout" placeholder="连接超时">
                                <span class="input-group-addon">秒</span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group form-inline">
                        <label class="col-sm-2 control-label"></label>
                        <div class="col-sm-10">
                            <button type="submit" class="btn btn-default" ng-disabled="processing">保存设置</button>
                        </div>
                    </div>
                </form>
            </div>
            <div class="tab-pane" ng-class="'active' | iftrue:activeTabName=='ext'" id="ext">
                <div srvext ng-init="name='Apache';pkg='apache';"></div>
            </div>
            <div class="tab-pane" ng-class="'active' | iftrue:activeTabName=='configfile'" id="configfile">
                <div srvfile ng-init="items=[
                {name:'主目录', path:'/etc/httpd', isdir:true},
                {name:'主配置', path:'/etc/httpd/conf/httpd.conf', isfile:true},
                {name: 'MIME类型', path:'/etc/httpd/conf/magic', isfile: true},
                {name:'扩展配置', path:'/etc/httpd/conf.d', isdir: true}];"></div>
            </div>
            <div class="tab-pane" ng-class="'active' | iftrue:activeTabName=='logfile'" id="logfile">
                <div srvlog ng-init="items=[{name:'日志目录', path:'/var/log/httpd', isdir:true}];"></div>
            </div>
            <div class="tab-pane" ng-class="'active' | iftrue:activeTabName=='update'" id="update">
                <div srvupdate ng-init="name='Apache';pkg='apache';"></div>
            </div>
            <div class="tab-pane" ng-class="'active' | iftrue:activeTabName=='uninstall'" id="uninstall">
                <div srvuninstall ng-init="name='Apache';pkg='apache';"></div>
            </div>
        </div>
    </div>

</div>